package Data::Conveyor::Ticket::Payload::Common_TEST;

# $Id: Common_TEST.pm 13653 2007-10-22 09:11:20Z gr $

use strict;
use warnings;
use Test::More;


our $VERSION = '0.02';


use base 'Data::Conveyor::Test';


sub PLAN {
    my $self = shift;
    # $::delegate->TS and ->RC in numeric context return the arrayref
    $::delegate->TS_COUNT + $::delegate->RC_COUNT + 4;
}


sub run {
    my $self = shift;
    $self->SUPER::run(@_);

    my $obj = $self->make_real_object;

    $self->obj_ok($obj->default_rc,     'value_ticket_rc');
    $self->obj_ok($obj->default_status, 'value_ticket_status');

    my $ticket = $self->delegate->make_obj('ticket');

    is($obj->rc($ticket), $self->delegate->RC_OK,
        'rc without exceptions is RC_OK');
    is($obj->status($ticket), $self->delegate->TS_RUNNING,
        'status without exceptions is TS_RUNNING');

    for my $rc (sort $self->delegate->RC) {
        $obj->default_rc($rc);
        is($obj->rc($ticket), $rc, "effect of default [$rc] on rc");
    }

    for my $status (sort $self->delegate->TS) {
        $obj->default_status($status);
        is($obj->status($ticket), $status,
            "effect of default [$status] on status");
    }

}


1;


__END__

{% USE p = PodGenerated %}

=head1 NAME

{% p.package %} - stage-based conveyor-belt-like ticket handling system

=head1 SYNOPSIS

    {% p.package %}->new;

=head1 DESCRIPTION

None yet. This is an early release; fully functional, but undocumented. The
next release will have more documentation.

=head1 METHODS

=over 4

{% p.write_methods %}

=back

{% p.write_inheritance %}

{% PROCESS standard_pod %}

=cut

